package com.cloudcreativity.blyg.sqlite;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.DaoException;

@Entity
public class Provider {

    @Id(autoincrement = true)
    private Long id;
    @NotNull
    private String name;
    @NotNull
    private String provinceId;
    @NotNull
    private String cityId;
    @NotNull
    private String areaId;

    @ToOne(joinProperty = "provinceId")
    private Province province;

    @ToOne(joinProperty = "cityId")
    private City city;

    @ToOne(joinProperty = "areaId")
    private Area area;

    private String addressDetail;

    @NotNull
    private String contactMan;

    @NotNull
    private String contactMobile;

    private String contactPhone;

    private String email;

    private String remark;

    private String createTime;

    private String updateTime;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 1099923148)
    private transient ProviderDao myDao;
    @Generated(hash = 1689569183)
    private transient String province__resolvedKey;
    @Generated(hash = 506912382)
    private transient String city__resolvedKey;
    @Generated(hash = 1475422299)
    private transient String area__resolvedKey;
    @Generated(hash = 1928352371)
    public Provider(Long id, @NotNull String name, @NotNull String provinceId,
            @NotNull String cityId, @NotNull String areaId, String addressDetail,
            @NotNull String contactMan, @NotNull String contactMobile,
            String contactPhone, String email, String remark, String createTime,
            String updateTime) {
        this.id = id;
        this.name = name;
        this.provinceId = provinceId;
        this.cityId = cityId;
        this.areaId = areaId;
        this.addressDetail = addressDetail;
        this.contactMan = contactMan;
        this.contactMobile = contactMobile;
        this.contactPhone = contactPhone;
        this.email = email;
        this.remark = remark;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
    @Generated(hash = 2018611927)
    public Provider() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getProvinceId() {
        return this.provinceId;
    }
    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }
    public String getCityId() {
        return this.cityId;
    }
    public void setCityId(String cityId) {
        this.cityId = cityId;
    }
    public String getAreaId() {
        return this.areaId;
    }
    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }
    public String getAddressDetail() {
        return this.addressDetail;
    }
    public void setAddressDetail(String addressDetail) {
        this.addressDetail = addressDetail;
    }
    public String getContactMan() {
        return this.contactMan;
    }
    public void setContactMan(String contactMan) {
        this.contactMan = contactMan;
    }
    public String getContactMobile() {
        return this.contactMobile;
    }
    public void setContactMobile(String contactMobile) {
        this.contactMobile = contactMobile;
    }
    public String getContactPhone() {
        return this.contactPhone;
    }
    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }
    public String getEmail() {
        return this.email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getRemark() {
        return this.remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getCreateTime() {
        return this.createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public String getUpdateTime() {
        return this.updateTime;
    }
    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1584826032)
    public Province getProvince() {
        String __key = this.provinceId;
        if (province__resolvedKey == null || province__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ProvinceDao targetDao = daoSession.getProvinceDao();
            Province provinceNew = targetDao.load(__key);
            synchronized (this) {
                province = provinceNew;
                province__resolvedKey = __key;
            }
        }
        return province;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1901007011)
    public void setProvince(@NotNull Province province) {
        if (province == null) {
            throw new DaoException(
                    "To-one property 'provinceId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.province = province;
            provinceId = province.getId();
            province__resolvedKey = provinceId;
        }
    }
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 433813234)
    public City getCity() {
        String __key = this.cityId;
        if (city__resolvedKey == null || city__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            CityDao targetDao = daoSession.getCityDao();
            City cityNew = targetDao.load(__key);
            synchronized (this) {
                city = cityNew;
                city__resolvedKey = __key;
            }
        }
        return city;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1148592723)
    public void setCity(@NotNull City city) {
        if (city == null) {
            throw new DaoException(
                    "To-one property 'cityId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.city = city;
            cityId = city.getId();
            city__resolvedKey = cityId;
        }
    }
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 2094262241)
    public Area getArea() {
        String __key = this.areaId;
        if (area__resolvedKey == null || area__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            AreaDao targetDao = daoSession.getAreaDao();
            Area areaNew = targetDao.load(__key);
            synchronized (this) {
                area = areaNew;
                area__resolvedKey = __key;
            }
        }
        return area;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 392425724)
    public void setArea(@NotNull Area area) {
        if (area == null) {
            throw new DaoException(
                    "To-one property 'areaId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.area = area;
            areaId = area.getId();
            area__resolvedKey = areaId;
        }
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 135563330)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getProviderDao() : null;
    }
}
